package com.you.atlas.web.member.module.control;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.place.dal.dao.AlbumDAO;
import com.you.place.dal.dao.CollectDAO;
import com.you.place.dal.dao.NoteDAO;
import com.you.place.dal.dao.RateDAO;

public class Banner {

    @Autowired
    private NoteDAO    noteDAO;
    
    @Autowired
    private AlbumDAO   albumDAO;

    @Autowired
    private CollectDAO collectDAO;

    @Autowired
    private RateDAO    rateDAO;

    public void execute(Context context) {
        Long  memberId = (Long) context.get("memberId");
        context.put("noteCount", noteDAO.countByMemberId(memberId));
        context.put("photoCount", albumDAO.countByMemberId(memberId));
        context.put("collectCount", collectDAO.count(memberId));
        context.put("rateCount", rateDAO.count(memberId));
    }
}
